package com.skytech.component.crawler.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;



public class ListRegex {

    public static List<String> regex(List<String> all,String rules){
        List<String> result = new ArrayList<>();
        Pattern pattern = Pattern.compile(rules);
        for (String s : all) {
            if(pattern.matcher(s).matches()){
                result.add(s);
            }
        }
        return result;
    }
}
